package cn.hchaojie.javase.day03;

import javax.xml.stream.events.StartDocument;

import org.junit.Test;

/**
 * 报数游戏
	被7整除的数不能念
 * @author hchaojie
 *
 */
public class TestReportNumber {
	@Test
	public void test() {
		int start = 1;
		while(true) {
			if (start >= 100) {
				break;
			}

			if (start % 7 != 0) {
				System.out.println(start);
			}
			start++;
		}
	}
	
	@Test
	public void test2() {
		for (int i = 1; i <= 100; i++) {
			if (i % 7 == 0) {
				continue;	// 结束本次循环，直接进入下次循环
			}

			System.out.println(i);
		}
	}
	
	@Test
	public void test3() {
		for (int i = 1; i <= 5; i++) {
			for (int j = 1; j <= 5; j++) {
				System.out.print("*");
				
				if (j == 3) {
					return;
				}
			}
			
			System.out.println();
		}
	}
	
	// 跳出外层循环
	@Test
	public void test4() {
		for (int x = 1; x <= 5; x++) {
			text:
			for (int i = 1; i <= 5; i++) {
				for (int j = 1; j <= 5; j++) {
					System.out.print("*");
					
					if (j == 3) {
						break text;
					}
				}
				
				System.out.println();
			}
		}
	
		System.out.println("aaa");
	}
}
